package chapter5.using_factory_bean;

import java.security.MessageDigest;

/**
 * 
 * @author chauthanhthang
 * @comment example create bean with factory-bean and factory-method
 */
public class MessageDigestFactory {
	private String algorithmName = "MD5";

	public MessageDigest createInstance() throws Exception {
		return MessageDigest.getInstance(algorithmName);
	}

	public void setAlgorithmName(String algorithmName) {
		this.algorithmName = algorithmName;
	}

}
